perf(zkatdlog): optimize IPA prover using native gnark-crypto arithmetic - #2154
perf(zkatdlog): optimize IPA prover using native gnark-crypto arithmetic#2154SurbhiAgarwal1 wants to merge 2 commits into
Conversation
aca7240 to
d4f768b
Compare
Signed-off-by: Surbhi Agarwal <SurbhiAgarwal1@users.noreply.github.com>
d4f768b to
4b48652
Compare
|
Hi @adecaro and @AkramBitar , I have updated the PR branch (
Could you please trigger/re-run the CI workflows and let me know if any further changes are needed? Thanks! |
|
Thanks a lot for submitting this PR! Regards, |
|
Could you please help to review this PR? Thanks a lot, |
|
Thanks for this, @SurbhiAgarwal1, the native-arithmetic port of the inner-product/MSM prep looks good and follows the existing GnarkFr[T] pattern correctly. |
Thanks a lot for your support. Regards, |
|
Hi @neetance and @AkramBitar, Here are the benchmark numbers for the native gnark-crypto arithmetic path:
Please see the attached terminal benchmark output below for complete details. Thanks! |
|
Hi @SurbhiAgarwal1, Thanks a lot for running the benchmarks! I assume these are the results after the fix. It would be great if we could also have the benchmark numbers from before and after the changes, so we can make a complete comparison and see the overall impact of this PR, as @neetance mentioned above. Thanks a million, |
|
Hello @SurbhiAgarwal1 Any update on that PR? Regards, |
|
Hi @AkramBitar, apologies for the delay. I’ve been busy with some other work and haven’t been able to get back to this yet. I’ll work on the before-and-after benchmark comparison and update the PR within the next 2–3 days. Thanks for your patience! |
|
@SurbhiAgarwal1 |

Description
This PR introduces native gnark-crypto field arithmetic for the Inner Product Argument (IPA) prover to eliminate the allocation overhead of the generic mathlib wrapper in tight reduction loops. Supersedes #1912.
As discussed in #1432 and the parent performance epic (#954), the core curve layer heavily relies on mathlib interface allocations, which becomes a bottleneck during Bulletproof/IPA proof generation.
Changes Made
ipa_native.gocontainingnativeIPAReduceto execute round reductions natively.ipaProver.reduceto dynamically dispatch execution based on the underlying curve viamath.DispatchCurve(BLS12-381 and BN254).math.GnarkFr[T]) for in-place scalar computations.Related Issues
Type of Change
Testing Done
make unit-tests)